home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-05-23 | 1.0 KB | 31 lines |
- // DeviceDriver
- // When the server sees a get or put request for a file with type
- // jfs/special, instead of calling the FileSystem to do something it
- // instead creates a device driver object from the class <file>Device, where
- // <file> is the name of the device file. All device driver classes must be
- // subclasses from this DeviceDriver class and should override one or
- // both of the read and write methods.
- import java.io.IOException;
- import Message;
-
- public abstract class DeviceDriver
- {
- // read
- // Called when a get() request comes in for this device. Actual
- // device drivers should override this to return some data read
- // from the device, based on the given message.
- Message read(Message msg, ServerClient s) throws IOException
- {
- throw new IOException("Cannot read from this device");
- }
-
- // write
- // Called when a put() request comes in for this device. This should
- // do something based on the given message.
- void write(Message msg, ServerClient s) throws IOException
- {
- throw new IOException("Cannot write to this device");
- }
- }
-
-